package com.iran.tax;

import com.iran.tax.rangeImpl.FirstRange;
import com.iran.tax.rangeImpl.NormalRange;
import com.iran.tax.rangeImpl.SecondRange;

public class Operator {
    private Range range;
    public Operator(int afterSalary){
        if (afterSalary<5000){
            range = new NormalRange();
        }else if (afterSalary<8000){
            range = new FirstRange();
        }else {
            range = new SecondRange();
        }
    }
    public Double getResult(int money){
        return range.getTax(money);
    }
}
